using DG.Tweening;
using UnityEngine;
public class TweenRotateByMouse : MonoBehaviour
{
    private void Start()
    {
        transform.DOLocalRotate(Vector3.up * 360, 4, RotateMode.LocalAxisAdd)
            .SetEase(Ease.Linear).SetId<Tween>("move").SetLoops(-1);
        DOTween.Pause("move");
    }

    void Update()
    {
        if (Input.GetMouseButton(0))
        {
            DOTween.Play("move");
        }

        if (Input.GetMouseButtonUp(0))
        {
            DOTween.Pause("move");
        }
    }
}
